<!-- 文本导航 -->
<template>
	<view class="text-nav df-cen-rl" :style="{ paddingLeft: padLeft + 'rpx', paddingRight: padRight + 'rpx', paddingTop: padTop + 'rpx', paddingBottom: padBottom + 'rpx' }">
		<view class="text-nav-title" :style="{ fontSize: options.fontSize + 'px', color: options.textColor }">{{ textList[0].text }}</view>
		<view class="text-nav-right" @click="jumpLink">
			更多惊喜
			<text class="cuIcon-right"></text>
		</view>
	</view>
</template>

<script>
import { mapGetters } from 'vuex';
import Qs from 'qs';
export default {
	name: 'text-nav',
	data() {
		return {};
	},
	props: {
		padLeft: {
			type: [Number, String],
			default: 30
		},
		padRight: {
			type: [Number, String],
			default: 20
		},
		padTop: {
			type: [Number, String],
			default: 20
		},
		padBottom: {
			type: [Number, String],
			default: 20
		},
		options: {
			type: Object,
			default: () => {
				return {};
			}
		},
		textList: {
			type: Array,
			default: () => {
				return [];
			}
		}
	},
	computed: {
		...mapGetters(['isVerify'])
	},
	methods: {
		jumpLink() {
			let newUrl = this.textList[0].link.wap_url;
			// console.log('log',this.textList[0]);
			// this.$Utils.jumpCustom(val);
			let newQuery = {};
			if (newUrl != '') {
				// #ifdef MP-WEIXIN
				if (newUrl == '/pages/discover/discover?inx=1') {
					if (this.isVerify == 0) {
						this.$Utils.tip('暂未开放，敬请期待~~~');
						return false;
					}
				}
				// #endif
				let newArr = newUrl.split('?');
				if (newArr.length > 1) {
					newQuery = Qs.parse(newArr[1]);
				}
				this.$Router.push({
					path: newArr[0],
					query: newQuery
				});
			} else {
				this.$Utils.tip('该功能正在逐步开发，敬请期待~~~');
			}
			//
		}
	},
	mounted() {}
};
</script>

<style lang="scss">
.text-nav {
	.text-nav-right {
		font-size: 22rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #fd3b5c;
	}
}
</style>
